'use strict';
// 云函数register的代码
const uniID = require('uni-id')
exports.main = async function(event, context) {
  const res = await uniID.loginByWeixin({code: event.code})
  await uniID.updateUser({
    uid: res.uid,
    nickname: event.nickName,
    gender: event.gender,
    avatar: event.avatarUrl
  })
  return res
}
